﻿<Page
    x:Class="GeolocationSample.MainPage"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:GeolocationSample"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
	
    <Grid Style="{StaticResource LayoutRootStyle}">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
		</Grid.RowDefinitions>
		
		<TextBlock Grid.Row="0" Text="Geolocation Sample" Style="{StaticResource HeaderTextStyle}" Margin="12,20,0,20" />
		
		<Grid Grid.Row="1" Margin="12,0,12,0">
			<Grid.Resources>
				<Style TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}" />
			</Grid.Resources>
			
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="40*" />
				<ColumnDefinition Width="60*" />
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="80" />
				<RowDefinition Height="40" />
				<RowDefinition Height="40" />
				<RowDefinition Height="40" />
				<RowDefinition Height="40" />
				<RowDefinition Height="40" />
				<RowDefinition Height="40" />
				<RowDefinition Height="40" />
				<RowDefinition Height="40" />
				<RowDefinition Height="40" />
			</Grid.RowDefinitions>

			<StackPanel Grid.Row="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center">
				<Button Command="{Binding GetPosition}">Get Location</Button>
				<Button Command="{Binding ToggleListening}">Toggle Listening</Button>
			</StackPanel>

			<TextBlock Grid.Row="1" Grid.Column="0">Status:</TextBlock>
			<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Status}" />

			<TextBlock Grid.Row="2" Grid.Column="0">Time:</TextBlock>
			<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding CurrentPosition.Timestamp}" />

			<TextBlock Grid.Row="3" Grid.Column="0">Latitude:</TextBlock>
			<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding CurrentPosition.Latitude}" />

			<TextBlock Grid.Row="4" Grid.Column="0">Longitude:</TextBlock>
			<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding CurrentPosition.Longitude}" />

			<TextBlock Grid.Row="5" Grid.Column="0">Accuracy:</TextBlock>
			<TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding CurrentPosition.Accuracy}" />

			<TextBlock Grid.Row="6" Grid.Column="0">Heading:</TextBlock>
			<TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding CurrentPosition.Heading}" />

			<TextBlock Grid.Row="7" Grid.Column="0">Altitude:</TextBlock>
			<TextBlock Grid.Row="7" Grid.Column="1" Text="{Binding CurrentPosition.Altitude}" />

			<TextBlock Grid.Row="8" Grid.Column="0">Altitude Accuracy:</TextBlock>
			<TextBlock Grid.Row="8" Grid.Column="1" Text="{Binding CurrentPosition.AltitudeAccuracy}" />

			<TextBlock Grid.Row="9" Grid.Column="0">Speed:</TextBlock>
			<TextBlock Grid.Row="9" Grid.Column="1" Text="{Binding CurrentPosition.Speed}" />
		</Grid>
    </Grid>
</Page>
